<%--
  Created by IntelliJ IDEA.
  User: dailyblue
  Date: 2024/1/21
  Time: 16:53
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>pageContext对象</title>
</head>
<body>
<%
    // 获取其他对象
    Object page1 = pageContext.getPage();
    ServletRequest request1 = pageContext.getRequest();
    ServletResponse response1 = pageContext.getResponse();
    // 操纵其他容器
    // 1.page容器 2.request容器 3.session容器 4.application容器
    pageContext.setAttribute("A", "AAA", 1);
    pageContext.setAttribute("A", "BBB", 2);
    pageContext.setAttribute("A", "CCC", 3);
    pageContext.setAttribute("A", "DDD", 4);
    Object a = pageContext.getAttribute("A", 1);
    Object b = request.getAttribute("A");
    Object c = session.getAttribute("A");
    Object d = application.getAttribute("A");
    out.print(a + "<br/>");
    out.print(b + "<br/>");
    out.print(c + "<br/>");
    out.print(d + "<br/>");
%>
</body>
</html>